<template>
	<view class="wrapper">
		<button class="auth-button" @click="chooseImage">从相册选图或拍照</button>
		<view v-for="(item,i) in imgArr">
			<image :src="item"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgArr: []
			}
		},
		onLoad() {
			this.chooseImage();
		},
		methods: {
			chooseImage() {
				let that = this;
				uni.chooseImage({
				    success: function (res) {
						console.log(res);
				        console.log(JSON.stringify(res.tempFilePaths));
						that.imgArr = res.tempFilePaths;
						console.log(that.imgArr);
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
	.wrapper {
		text-align: center;
	}
	
	.auth-button {
		width: 80%;
		margin: 58rpx auto 70rpx auto;
	}
</style>
